import request from "@/utils/request";

// 查询文件列表
export function listUnit(query) {
  return request({
    url: "units",
    method: "get",
    params: query,
  });
}

//查询单元
export function getUnit(unitId){
  return request({
    url:'units/'+unitId,
    method:'get'
  })
}

//删除单元
export function deleteUnit(unitId){
  return request({
    url:'units/'+unitId,
    method:'delete'
  })
}
// 新增单元
export function addUnit(data){
  return request({
    url: '/units',
    method: 'post',
    data: data
  })
}

// 更新单元
export function updateUnit(data){
  return request({
    url: '/units',
    method: 'put',
    data: data
  })
}

